<template>
    <div>
      <FilterTable
        ref="tableCar"
        :columns="formList"
        :params="fetchParams"
        :dataSource= "data"
        :datakey="'data'"
        :isColumnFilter = "false"
        :isSelectColumn="false"
        :isPagination = "false"
        :onPageChange="handleTablePageChange"
        :onColumnsChange="(columns) => (this.columns = columns)"
        columnsRef="notification_maintain_index_01"
      >
        <div style="padding-top: 1rem;"></div>
        <multiuse-button @click="closeDialog">关 闭</multiuse-button>
      </FilterTable>
      <div class="dialogBottmView">
        <el-button @click="closeDialog()">关 闭</el-button>
      </div>
    </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import { queryClaimLabour } from '@/api/claim/factory/LaborHourPrice';
export default {
  mixins: [dictionary],
  components: {},
  props: {
    rowData: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      fetchParams: {}, //ipa 接口
      saveData:null,
      formList: this.createFormList1(),
      loading: false,
      fetchApi:queryClaimLabour,
      formData: {},
      ownerName:null,
      data:[]
    };
  },
  mounted(){
    this.selClaimLabour();
  },

  methods: {
    async selClaimLabour(){

      console.log("this.fetchParams",this.fetchParams)
      let row = JSON.parse(JSON.stringify(this.rowData));
      let ownerName =  this.rowData.ownerName;
      let seriesCode =  this.rowData.seriesCode;
      // this.fetchParams = Object.assign({seriesCode}, seriesCode, seriesCode);
      // this.fetchParams = Object.assign("ownerName", this.fetchParams, ownerName);
      this.fetchParams = Object.assign({}, this.fetchParams, seriesCode, { seriesCode: seriesCode},{ xhrAbort: false });

      let res =  await queryClaimLabour(row)
      if (res.resultCode === 200){
        this.data = res
      }
      console.log("this.data",this.data)
    },
    formChangeHandle(val) {
      this.saveData = val;
      this.saveData = this.rowData
    },
    //取消操作
    closeDialog() {
      this.$emit('close', false);
    },
    // table页码变化
    handleTablePageChange(e) {
      this.pageSelectRows = [];
    },
    //table表头和数据源
    createFormList1() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 60,
          sorter: true,
          fixed: 'left',
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        { title: '服务中心代码',dataIndex: 'ownerCode',sorter: true },
        { title: '服务中心名称', dataIndex: 'ownerName', sorter: true },
        { title: '索赔工时单价',  dataIndex: 'labourPrice', sorter: true },
        { title: '生效日期',  dataIndex: 'validDate', sorter: true },
        { title: '修改人', dataIndex: 'updatedBy', sorter: true },
        { title: '修改时间', dataIndex: 'updatedAt',dateFormat: 'yyyy-MM-dd HH:mm:ss', sorter: true }
      ];
    }
  },
};
</script>

<style lang="less" scoped></style>
